/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FRReportes.java
 *
 * Created on Nov 1, 2011, 8:15:12 PM
 */

package Interfaz;

import Negocio.UI.UIPuntoVenta;
import java.util.Date;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTable;

/**
 *
 * @author Marco
 */
public class FRReportes extends javax.swing.JFrame {

    /** Creates new form FRReportes */
    private UIPuntoVenta uiPuntoVenta = UIPuntoVenta.getInstancia();
   
   
    public FRReportes() {
        initComponents();
        setSize(800, 600);
        setLocationRelativeTo(this);
     
        //uiPuntoVenta.cargarReporte();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        bMenuPrincipal = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        bVentasPorDia = new javax.swing.JButton();
        bImprimir = new javax.swing.JButton();
        bComisionPorDia = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        bFichasPorDia = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblResults = new javax.swing.JTable();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        dateDesde = new com.standbysoft.component.date.swing.JDatePicker();
        dateHasta = new com.standbysoft.component.date.swing.JDatePicker();
        lblTipoReporte = new javax.swing.JLabel();
        lblIDReporte = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel3.setBackground(new java.awt.Color(102, 51, 255));
        jPanel3.setLayout(null);

        jLabel1.setFont(new java.awt.Font("Microsoft JhengHei", 1, 18));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Reportes");
        jPanel3.add(jLabel1);
        jLabel1.setBounds(146, 29, 296, 28);

        bMenuPrincipal.setFont(new java.awt.Font("MS Reference Sans Serif", 1, 18));
        bMenuPrincipal.setForeground(new java.awt.Color(0, 51, 51));
        bMenuPrincipal.setText("Menú Principal");
        bMenuPrincipal.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(51, 0, 51), 2, true));
        bMenuPrincipal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bMenuPrincipalActionPerformed(evt);
            }
        });
        jPanel3.add(bMenuPrincipal);
        bMenuPrincipal.setBounds(10, 10, 180, 80);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        bVentasPorDia.setFont(new java.awt.Font("MS Reference Sans Serif", 1, 12)); // NOI18N
        bVentasPorDia.setForeground(new java.awt.Color(0, 153, 102));
        bVentasPorDia.setText("Informe de Ventas");
        bVentasPorDia.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 255, 153), 2, true));
        bVentasPorDia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bVentasPorDiaActionPerformed(evt);
            }
        });

        bImprimir.setFont(new java.awt.Font("MS Reference Sans Serif", 1, 12));
        bImprimir.setText("Imprimir");
        bImprimir.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 2, true));

        bComisionPorDia.setFont(new java.awt.Font("MS Reference Sans Serif", 1, 12)); // NOI18N
        bComisionPorDia.setForeground(new java.awt.Color(255, 51, 51));
        bComisionPorDia.setText("Informe de Comisión");
        bComisionPorDia.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 153, 153), 2, true));
        bComisionPorDia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bComisionPorDiaActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel2.setText("Informe Seleccionado :");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel3.setText("Rango de Fechas :");

        bFichasPorDia.setFont(new java.awt.Font("MS Reference Sans Serif", 1, 12));
        bFichasPorDia.setForeground(new java.awt.Color(0, 153, 153));
        bFichasPorDia.setText("Informe de Fichas");
        bFichasPorDia.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(102, 255, 255), 2, true));
        bFichasPorDia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bFichasPorDiaActionPerformed(evt);
            }
        });

        tblResults.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(tblResults);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 472, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 314, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        jLabel4.setText("Desde: ");

        jLabel5.setText("Hasta:");

        lblTipoReporte.setText("Informe de Fichas");

        lblIDReporte.setText("Inactivo");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(310, 310, 310)
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(bFichasPorDia, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(bVentasPorDia, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(bComisionPorDia, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(76, 76, 76)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel4)
                                        .addGap(18, 18, 18)
                                        .addComponent(dateDesde, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(40, 40, 40)
                                        .addComponent(jLabel5)
                                        .addGap(18, 18, 18)
                                        .addComponent(dateHasta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(lblTipoReporte)
                                        .addGap(94, 94, 94)
                                        .addComponent(lblIDReporte))))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(678, 678, 678)
                        .addComponent(bImprimir, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel4)
                        .addComponent(jLabel5))
                    .addComponent(dateDesde, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(dateHasta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(16, 16, 16)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(30, 30, 30)
                        .addComponent(bImprimir, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblTipoReporte)
                            .addComponent(lblIDReporte))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(bFichasPorDia, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(51, 51, 51)
                                .addComponent(bComisionPorDia, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 56, Short.MAX_VALUE)
                                .addComponent(bVentasPorDia, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(27, 27, 27))
                            .addComponent(jPanel2, 0, 314, Short.MAX_VALUE))))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        jLabel5.getAccessibleContext().setAccessibleName("Hasta :");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 790, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 792, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void bMenuPrincipalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bMenuPrincipalActionPerformed
        uiPuntoVenta.framePrincipalBailarinas();        // TODO add your handling code here:
    }//GEN-LAST:event_bMenuPrincipalActionPerformed

    private void bFichasPorDiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bFichasPorDiaActionPerformed
          Date desde;
          Date hasta;
          //Los parametros siempre seran fechas y tipo de reporte a crear
          desde = dateDesde.getSelectedDate();
          hasta = dateHasta.getSelectedDate();
          lblIDReporte.setText("0");
          lblTipoReporte.setText("Informe de Fichas");
          uiPuntoVenta.cargarReporte(lblIDReporte.getText(), desde, hasta);//cargadorReporte sobrecargado
    }//GEN-LAST:event_bFichasPorDiaActionPerformed

    private void bComisionPorDiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bComisionPorDiaActionPerformed
          Date desde;
          Date hasta;
          //Los parametros siempre seran fechas y tipo de reporte a crear
          desde = dateDesde.getSelectedDate();
          hasta = dateHasta.getSelectedDate();
          lblIDReporte.setText("1");
          lblTipoReporte.setText("Informe de Comision");
          uiPuntoVenta.cargarReporte(lblIDReporte.getText(), desde, hasta);//cargadorReporte sobrecargado
    }//GEN-LAST:event_bComisionPorDiaActionPerformed

    private void bVentasPorDiaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bVentasPorDiaActionPerformed
          Date desde;
          Date hasta;
          //Los parametros siempre seran fechas y tipo de reporte a crear
          desde = dateDesde.getSelectedDate();
          hasta = dateHasta.getSelectedDate();
          lblIDReporte.setText("2");
          lblTipoReporte.setText("Informe de Ventas");
          uiPuntoVenta.cargarReporte(lblIDReporte.getText(), desde, hasta);//cargadorReporte sobrecargado
    }//GEN-LAST:event_bVentasPorDiaActionPerformed
   //SetGets
    public JLabel getlblIDReporte()
    {
        return lblIDReporte;
    }
    public void setlblIDReporte(String text)
    {
        this.lblIDReporte.setText(text);
    }
    public JLabel getlblTipoReporte()
    {
        return lblTipoReporte;
    }
    public void setlblTipoReporte(String text)
    {
        this.lblTipoReporte.setText(text);
    }
     public JTable getTblResults()
    {
        return tblResults;
    }
      public void setTblResults(JTable table)
    {
        this.tblResults = table;
    }
     public JPanel getPnlPanel()
    {
        return jPanel2;
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FRReportes().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bComisionPorDia;
    private javax.swing.JButton bFichasPorDia;
    private javax.swing.JButton bImprimir;
    private javax.swing.JButton bMenuPrincipal;
    private javax.swing.JButton bVentasPorDia;
    private com.standbysoft.component.date.swing.JDatePicker dateDesde;
    private com.standbysoft.component.date.swing.JDatePicker dateHasta;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblIDReporte;
    private javax.swing.JLabel lblTipoReporte;
    private javax.swing.JTable tblResults;
    // End of variables declaration//GEN-END:variables

}
